// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'

import jiankunMap from 'jiankun_map'
Vue.config.productionTip = false
Vue.use(jiankunMap.vue)

import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);

Vue.prototype.user = {
  id: null,
  name: "游客"+Math.random(),
  images: "/img/logo.png" //头像
}

//创建VueX对象
import Vuex from "vuex"
Vue.use(Vuex)
const store = new Vuex.Store({
  state:{
      //存放的键值对就是所要管理的状态
      user: { isCheck: 0 }
  },
  getters: {
    user (state){
      return state.user;
    }
  },
  mutations: {
    SETUSER(state,value){
      state.user = value
    }
  },
  actions:{
    setUser({commit},value){
      commit('SETUSER',value)
    }
  }
})


/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})
